/** BCMI_Frame name space specification.
 *
 *  BCMI_Frame name space specification. 
 *  bcmi_frame is the total framework contain the MPI_Frame and M3_Frame.
 *
 *  @author : huicong
 *  @date : 2008-10-26
 *
 */

#ifndef _BCMI_FRAME_H
#define _BCMI_FRAME_H

#include "BasicHeader.h"

namespace bcmi_frame
{
#define BCMI_FRAME_DATA_STRUCTURE_DEFINE

    /** Basic data structure, all class will be transfer by stream must inherit this class. */
    VIRTUAL_CLASS class BasicDataStructure;

#undef BCMI_FRAME_DATA_STRUCTURE_DEFINE


#define BCMI_FRAME_IO_DEFINE

    /** Basic stream reader. User info will read from this class. */
    VIRTUAL_CLASS class StreamReader;
    /** Basic stream recver. Use to receive data. */
    VIRTUAL_CLASS class StreamRecver;
    /** MPI reader, use to receive the data as binary stream. 
     *
     * @see StreamReader
     * @see StreamRecver
     *
     */
    class MPIReader;

    /** Basic stream writer. User info will write in this class. */
    VIRTUAL_CLASS class StreamWriter;
    /** Basic stream sender. Use to send data. */
    VIRTUAL_CLASS class StreamSender;
    /** MPI writer, use to send the data as binary stream. 
     *
     * @see StreamWriter
     * @see StreamSender
     *
     */
    class MPIWriter;

#undef BCMI_FRAME_IO_DEFINE

#define BCMI_FRAME_TOOL_DEFINE

    /** Clock tool */
    class FrameClock;

    /** Log recorder */
    class LogRecorder;

#undef BCMI_FRAME_TOOL_DEFINE


    /** The major class which startup the parallel program */
    class ParallelFrame;
    /** The major class to manage job */
    class JobSystem;

    /** Frame Job Interface, function base of SimpleParallelJob, TaskPoolJob, PipeJob */
    VIRTUAL_CLASS class FrameJob;
    /** Frame Task Interface, function base of SimpoleParallelTask, TaskPoolTask, PipeTask*/
    VIRTUAL_CLASS class FrameTask;

    /** Null task , do nothing. Used to be default init and fin task in Job. */
    class DefaultNullTask;

    /** Main Easy parallel job scheme. */
    class EasyParallelJob;
    /** Easy parallel job process group manager. */
    class EasyParallelGroupManager;
    /** Easy parallel task interface */
    VIRTUAL_CLASS class EasyParallelTask;

    const static UINT MASTER_REMOTE_ID = 0; // frame master process mpi id
    /** mpi transfer common tag, use to transfer buffer */
    const static UINT FRAME_COMM_TAG = 0; 
    /** mpi transfer tag, use to transfer protocol */
    const static UINT FRAME_PROTOCOL_TAG = 1; 

    /** Recver & Sender buffer setting */
    const static UINT DEFAULT_MAX_POOL_SIZE = 64; // the default max pool size
    const static UINT DEFAULT_MAX_POOL_NUMBER = 10; // the default max pool number
};

#endif //#ifndef _BCMI_FRAME_H